#include<iostream>
#include<string>
using namespace std;
typedef long long LL;
const int N = 110;
string s1, s2;
int n, m, k;
int a[N], b[N];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> m >> k;
		cin >> s1 >> s2;
		string ans;
		for (int i = 0; i < s1.size(); i++) {
			int k = s1[i] - 'a' + 1;
			a[k]++;
		}
		for (int i = 0; i < s2.size(); i++) {
			int k = s2[i] - 'a' + 1;
			b[k]++;
		}
		int idx1 = 1, idx2 = 1;
		int cnt1 = 0, cnt2 = 0;
		int sum1 = 0, sum2 = 0;
		int flag = 0;
		while (1) {
			/*if (a[cnt] || b[cnt]) {
				if (a[cnt] >= b[cnt]) {
					char k = cnt + 'a' - 1;
					a[cnt]--;
					if (!a[cnt])cnt++;
					ans += k;
				}
				else {
					char k = cnt + 'a' - 1;
					b[cnt]--;
					ans += k;
				}
			}*/
			char z1 = idx1 + 'a' - 1;
			char z2 = idx2 + 'a' - 1;
			if (z1 < z2) {
				a[idx1]--;
				ans += z1;
				sum1++;
			}
			else if (z1 > z2) {
				b[idx2]--;
				ans += z2;
				sum2++;
			}
			else {
				if (n - sum1 <= m - sum2) {
					a[idx1]--;
					ans += z1;
					sum1++;
				}
				else {
					b[idx2]--;
					ans += z2;
					sum2++;
				}
			}
			if (!a[idx1])idx1++;
			if (!b[idx2])idx2++;
			if (sum1 == k) {
				sum1 = -1e5;
				sum2 = 0;
			}
			if (sum2 == k) {
				sum2 = 1e5;
				sum1 = 0;
			}
			bool flag = 0;
			for (int i = 1; i <= 26; i++) {
				if (!a[i]) {
					flag = 1;
					break;
				}
			}
			for (int i = 1; i <= 26; i++) {
				if (!b[i]) {
					flag = 1;
					break;
				}
			}
			if (!flag)break;
		}
		cout << ans << endl;
	}
	return 0;
}